<?php

class TranslateModel extends Model {
	
	public $definitions = array(
		"tables" => array("translate")
	);
	
	public $order = "id";
	public $order_direction = "DESC";
	
	public function get($lang, $entity, $id) {
		$ret = array();
		$res = $this->find("*", array("lang"=>$lang, "entity"=>$entity, "entity_id"=>$id));
		if($res) {
			foreach ($res as $row) {
				$ret[$row["entity_field"]] = $row["translate"];
			}
		}
		return $ret;
	}
	
}

?>